package com.resign.carl.decorate;

import com.resign.carl.decorate.api.Beverage;
import com.resign.carl.decorate.api.impl.*;
import com.resign.carl.decorate.enumeration.CapSize;

import java.io.*;

/**
 * decorate
 * Created by carl.zhao on 2016/6/14.
 */
public class StarbucksCoffee {

    public static void main(String[] args) throws IOException {
        Beverage beverage = new Espresso();
        beverage.setCapSize(CapSize.GRANDE);
        System.out.println("cost: $" + beverage.cost() + ",desc: " + beverage.getDescription());

        // create Object DarkRoast
        Beverage beverage2 = new DarkRoast();
        beverage2.setCapSize(CapSize.TALL);
        // decorate it with Mocha
        beverage2 = new Mocha(beverage2);
        // decorate it with Mocha
        beverage2 = new Mocha(beverage2);
        // decorate it with Whip
        beverage2 = new Whip(beverage2);
        System.out.println("cost: $" + beverage2.cost() + ",desc: " + beverage2.getDescription());

        Beverage beverage3 = new HouseBlend();
        beverage3.setCapSize(CapSize.WENTI);
        beverage3 = new Soy(beverage3);
        beverage3 = new Mocha(beverage3);
        beverage3 = new Whip(beverage3);
        System.out.println("cost: $" + beverage3.cost() + ",desc: " + beverage3.getDescription());

        //InputStream inputStream = new ObjectInputStream(new BufferedInputStream(new FileInputStream("")));
    }

}
